package com.atguigu.day16.array02.t;
/*
添加四个学生对象到Student[]
   使用Arrays.sort()对数组排序
      一个按照age
      一个按照score
 */
public class Student implements Comparable<Student> {

    @Override
    public int compareTo(Student o) {
        return this.age-o.age;
    }

    String name;
    int age;
    double score;

    public Student(String name, int age, double score) {
        this.name = name;
        this.age = age;
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", score=" + score +
                '}';
    }


}
